<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="../static/src/layui/css/layui.css">
		
		<script src="../static/src/layui/layui.js"></script>
		<!-- <script src="js/jquery.js"></script> -->
		<!-- <script src="city-picker/city-picker.data.js"></script>
		<script src="city-picker/city-picker.js"></script> -->
		<link rel="stylesheet" type="text/css" href="../static/src/city-picker/city-picker.css" />
		
		<link rel="stylesheet" href="../static/src/css/font.css">
		<link rel="stylesheet" href="../static/src/css/xadmin.css">
		<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
		<!-- <script src="lib/layui/layui.js" charset="utf-8"></script> -->
		<script type="text/javascript" src="../static/src/js/xadmin.js"></script>
	</head>
	<body>
		<div class="layui-tab">
		  <ul class="layui-tab-title">
		    <li class="layui-this">我的出价</li>
		    <li>搜索</li>
		  
		  </ul>
		  <div class="layui-tab-content">
		    <div class="layui-tab-item layui-show" style="position: relative;">
				<div>
					默认收货地址
					</div>
					<!--这个是收货地址-->
					<table class="layui-hide" id="test" lay-filter="test11">
						 
					</table>
				</div>
					 
					 <!--这个是查看我的地址的信息-->
		    <div class="layui-tab-item">
						<form class="layui-form" action="">
						
							<div class="layui-form-item">
								<label class="layui-form-label">商品名字</label>
								<div class="layui-input-block">
									<input type="text" maxlength="5" name="title" required lay-verify="required" placeholder="请输入标题,最大字数不超过5个" autocomplete="off" class="layui-input">
								</div>
							</div>
						
							<div class="layui-form-item">
								<label class="layui-form-label">价格</label>
								<div class="layui-input-block">
									<input type="text" maxlength="5" onkeyup="value=value.replace(/^(0-)|[^\d]+/g,'')" name="title2" required lay-verify="required" placeholder="请输入正整数" autocomplete="off" class="layui-input">
								</div>
							</div>

							<div class="layui-form-item">
								<!-- 注意：这一层元素并不是必须的 -->
								<label class="layui-form-label">时间</label>
								<!--日期只能选择不能手动输入 readonly="true"-->
								<input type="text" readonly="true" class="layui-input" id="timeOne" name="title6" style="width: 300px;	" placeholder="注意是在选择的出价时间之后">
							</div>
							<!-- 		</div> -->
							<div class="layui-form-item">
								<div class="layui-input-block">
									<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
									<button type="reset" class="layui-btn layui-btn-primary">重置</button>
								</div>
							</div>
						</form>
						
					<!-- 	<table class="layui-hide" id="test1">
								
							</table> -->
							
							<table class="layui-table layui-form">
							    <thead>
							        <tr>
							            
							            <th>订单编号</th>
							            <th>收货人</th>
							            <th>总金额</th>
							            <th>应付金额</th>
							           <!-- <th>操作</th> -->
							    </thead>
							    <tbody>
							        <tr>
							            <td>2017009171822298053</td>
							            <td>老王:18925139194</td>
							            <td>7829.10</td>
							            <td>7854.10</td>
										<!-- <td><button>删除</button></td> -->
							        </tr>
							    </tbody>
							</table>		 
			</div>
		
		  </div>
		</div>
	</body>
	
	<script type="text/javascript">
	   
	   
	<!--这个是导航栏定位-->
	layui.use('element','jquery', 'table', function(){
	  var $ = layui.jquery;
	  var element = layui.element;
				var table = layui.table;
				var form = layui.form;//Tab的切换功能，切换事件监听等，需要依赖element模块
	 	   
	  $('.site-demo-active').on('click', function(){
	    var othis = $(this), type = othis.data('type');
	    active[type] ? active[type].call(this, othis) : '';
	  });
	  //Hash地址的定位
	  var layid = location.hash.replace(/^#test=/, '');
	  element.tabChange('test', layid);
	  
	  element.on('tab(test)', function(elem){
	    location.hash = 'test='+ $(this).attr('lay-id');
	  }); 
				 	 
	});
	</script>
	
	<script type="text/html" id="barDemo">
	  <button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="shanchu">删除</button>
	  	  <button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="chakan" id="chakanTwo">查看</button>
	</script>
	
	
	
	<!--这个是显示出价记录表格-->
	<script>
	layui.use('table', function(){
	  var table = layui.table;

	  table.render({
	    elem: '#test'
	    // ,url:'/demo/table/user/'
	    ,cellMinWidth: 100 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
	    ,cols: [[
		  {field:'id', width:100, title: 'id'}
	      ,{field:'time', width:300, title: '时间'}
	      ,{field:'username', width:300, title: '标题'}
	      ,{field:'sex', width:300, title: '成交价'}
	      ,{field:'city', width:300, title: '操作' ,toolbar: '#barDemo' },

	    
	    ]],page: true
		  ,data: [{
		  "id": "10001"
		   ,"time": "杜甫"
		  ,"username": "杜甫"
		  ,"sex": "男"
		 
		}, {
		  "id": "10002"
		  ,"time": "杜甫"
		  ,"username": "杜甫"
		  ,"sex": "男"
		  
		}],
	  });
	  
	  // 监听行工具事件
	  table.on('tool(test11)', function(obj){
	    var data = obj.data;
	    //console.log(obj)
	    if(obj.event === 'shanchu'){
	      layer.confirm('确定删除嘛', function(index){
	        obj.del();
	  		// alert(obj);
	        layer.close(index);
			// location.reload();
	      });
	    }
		<!--这个是编辑弹出页面-->
		else if(obj.event === 'chakan'){
		      layer.open({
		        type: 2,//类型为2，解析URL
                title:'项目管理',//标题
                maxmin:true,
                area: ['1000px', '800px'],//弹出框大小
                shadeClose: true, //点击遮罩关闭
				content:"http:www.baidu.com"
		        
		      });
		};
	  });
	});
	</script>
	
	<!--这个是搜索框的js-->
	<script>
		layui.use(['form', 'layer', 'laydate', 'jquery', 'upload','table'], function() {
						var form = layui.form;
						var layer = layui.layer;
						var laydate = layui.laydate;
						var $ = layui.jquery;
						var upload = layui.upload;
						var table = layui.table;
						// var date = new Date();
		
						//执行一个laydate实例
						laydate.render({
							elem: '#timeOne', //指定元素
							// min: "7:00:00",
							// max: "20:59:59",
							type: 'datetime',
							format: 'yyyy-MM-dd HH:mm:ss'
						});
						//监听提交
							form.on('submit(formDemo)', function(data) {
								 layer.msg(JSON.stringify(data.field));
								alert("提交完毕可以添加图片");
								
								return false;
							});
						});
	</script>
	

</html>
